﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>弹出层</title>
</head>
<body>
	<script>
function A(){
    var w = document.createElement("div");
    w.setAttribute("id","mybody")
    with(w.style){
        position = 'absolute';
        zIndex = '10000';
        width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth)/2 + "px";
        height =Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight)/2 + "px";
        position="absolute";
        left = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth)/4 + "px";;
        top = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight)/4 + "px";
        background = '#000000';
        filter = 'Alpha(opacity=70)';
        opacity = '0.7';
    }
    document.body.appendChild(w);
    //**********************************************//
    var ig=document.createElement("div");
    ig.setAttribute("id","mypic")
    ig.innerHTML='点图关闭<img src="http://www.hao123.com/images/guangg/youa.gif" onclick="C()"/>';
    document.getElementById("mybody").appendChild(ig);
    with(ig.style){
        position = 'absolute';
        zIndex = '10001';
        left = '50%';
        top = '50%';
        marginLeft = - ig.offsetWidth / 2 + 'px';
        marginTop = - ig.offsetHeight / 2 + 'px';
    }
    document.body.appendChild(ig);
}
function C(){
    document.body.removeChild(mybody);
    document.body.removeChild(mypic);
}
</script>
	<a href="#" onclick="A()">点击这里弹出层</a>
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
	<br />ffffffffff
</body>
</html>